
public class Arn implements Comparable<Arn>
{
	private String family;
	private String species;
	private String id;
	private String length;
	private String type;
	private String anticodon;
	private String position; 
	private String score;
	private String seq;
	private String str; 
	
	// Constructors
	
	public Arn () { }
	
	// Operations
	
	public boolean valid()
	{
		// Test : ACGT
		for (int i=0; i<seq.length(); i++)
		{
			if (seq.charAt(i) != 'A' && seq.charAt(i) != 'C' &&
				seq.charAt(i) != 'G' && seq.charAt(i) != 'T')
			{
				//System.out.println("ACGT");
				return false;
			}
		}
		
		if (seq.contains("Error"))
		{
			//System.out.println("Seq: Error");
			return false;
		}
		
		if (type.contains("Undet"))
		{
			//System.out.println("Type: Undet");
			return false;
		}
		
		if (seq.length() != Integer.parseInt(length))
		{
			//System.out.println("Seq length");
			return false;
		}

		if (anticodon.contains("?"))
		{
			//System.out.println("Anticodon: ???");
			return false;
		}
		
		return true;
	}
	
	// Setters/Getters

	public void setFamily(String family) {
		this.family = family;
	}

	public String getFamily() {
		return family;
	}

	public void setSpecies(String species) {
		this.species = species;
	}

	public String getSpecies() {
		return species;
	}

	public void setLength(String length) {
		this.length = length;
	}

	public String getLength() {
		return length;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}

	public void setAnticodon(String anticodon) {
		this.anticodon = anticodon;
	}

	public String getAnticodon() {
		return anticodon;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getPosition() {
		return position;
	}

	public void setScore(String score) {
		this.score = score;
	}

	public String getScore() {
		return score;
	}

	public void setSeq(String seq) {
		this.seq = seq;
	}

	public String getSeq() {
		return seq;
	}

	public void setStr(String str) {
		this.str = str;
	}

	public String getStr() {
		return str;
	}
	
	public String toString ()
	{
		return ("\nFamily: "+family+"\nSpecies: "+species+"\nid: "+id+"\nlength: "+length+"\nType: "+type+"\nanticodon: "+anticodon+"\nposition: "+position+"\nScore: "+score+"\nSeq: "+seq+"\nStr: "+str);
	}

	public int compareTo(Arn a) {
		return this.anticodon.compareTo(a.anticodon);
	}
}
